<%-- 
    Document   : adddebt
    Created on : Dec 15, 2012, 10:35:34 AM
    Author     : Nguyen Hung
--%>

<%-- 
    Document   : popuptemplate
    Created on : Jun 4, 2012, 2:47:19 PM
    Author     : ems
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/jquery.fancybox-1.3.4.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>


        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
              
                var b = location.pathname;
                $j("input[id$='message']").val(b);
                validateform("job");
                $j('input#leavedate1,input#leavedate2').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j(".abc").live("change",function(){
                    var obj1 = $j(this).children("option:selected").val();
                    if(obj1 != null)
                    {
                        $j.post("actionDebt.jsp?action=cn&id="+obj1);
                    }
                });
            });
        </script>
        <style type="text/css">
            .ui-datepicker-trigger {
                margin-top: 2px !important;
            }
            #ui-datepicker-div {
                z-index: 9999999;
            }
            .number {
                text-align: right;
            }
            .content_popup {
                float: left;
                margin-top: 10px;
                width: 100%;
            }
            .fields_input {
                float: left;
                height: auto;
            }
            .radio_tour label {
                float: left;
                width: 90px !important;
            }
            .radio_tour input {
                float: left;
            }
            .fields_input label {
                color: black;
                float: left;
                font-size: 12px;
                padding: 4px;
                text-align: right !important;
                width: 115px;
            }
            .s400_left {
                float: left;
                padding: 5px 0;
                width: 45%;
            }
            .s400_right {
                float: left;
                padding: 5px 0;
                width: 52%;
            }
            .s400_content {
                float: left;
                padding: 5px 0;
                width: 100%;
            }
            .cbx_a000 {
                float: left;
                width: 151px;
            }
            .addbackground {
                background-color: #C9D7E5;
                padding: 0;
                width: 100% !important;
            }
            .lblMini {
                width: 59px !important;
            }
            .lbltimzone {
                width: 45px !important;
            }
            .lblcount {
                width: 60px !important;
            }
            .lblCondition {
                float: left;
                padding-top: 5px;
            }
            body, td, pre {
                color: #000000;
                font-family: Arial,Verdana,sans-serif;
                font-size: 12px !important;
            }
            .editor {
                float: left;
                font-size: 12px !important;
            }
            .popup-header {
                height: 54px !important;
            }
            .pricetour {
            }
            .datetour {
            }
            .timezonetour {
            }
            .counttour {
            }
            .label_number {
                width: 45px !important;
            }
            .popup-footer {
                height: 63px;
            }
            .content_popup{
                line-height: 17px;
            }

        </style>

    </head>

    <%-- doi tu s200 > s400: cac tham so sv402 = sv202 ... --%>
    <body style=" float:left; width:auto; height:auto; margin:0px; background: white">
        <f:view>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <a4j:form id="job" >
                <div class="popup" style="height:460px; width:100%">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="Thêm sản phẩm tour"/></div>
                    </div>
                    <div class="popup-content">
                        <div class="main_content">
                            <div class="content_popup">
                                <!-- -->
                                <div class="s400_content ">
                                    <div class="s400_content">
                                        <div class="fields_input">
                                            <label><h:outputText value="Tên tour"/> *:</label>
                                            <h:inputText value="#{SPBean.pvSV201}" style="width:510px" styleClass=" required "/>
                                        </div>                                    
                                    </div>                                    

                                </div>
                                <!-- -->
                                <div class="s400_content addbackground">
                                    <div class="fields_input addbackground">
                                        <h:selectOneRadio value="#{SPBean.vn079}" style="width:300px; margin-left:115px" styleClass="radio_tour" >
                                            <f:selectItem itemValue="0" itemLabel=" Tour trong nước" />
                                            <f:selectItem itemValue="1" itemLabel=" Tour nước ngoài" />
                                            <a4j:support event="onchange" reRender="country,target" actionListener="#{SPBean.changetarget}"/>
                                        </h:selectOneRadio>
                                    </div>                                    
                                </div>                                    

                                <div class="s400_content addbackground">
                                    <div class="s400_left ">
                                        <div class="fields_input">
                                            <label><h:outputText value="Điểm khởi hành"/> :</label>
                                            <h:selectOneMenu value="#{SPBean.pnFA000F}"  styleClass="cbx_a000">  
                                                <f:selectItems value="#{SPBean.cbxA000F}" />  

                                            </h:selectOneMenu> 

                                        </div>  
                                        <div class="fields_input">
                                            <label><h:outputText value="Quốc gia đến"/> :</label>
                                            <h:selectOneMenu value="#{SPBean.n750}" id="country"  styleClass="cbx_a000">  
                                                <f:selectItems value="#{SPBean.combN750}" />  
                                                <a4j:support event="onchange"  actionListener="#{SPBean.changeCountry}" reRender="target" />
                                            </h:selectOneMenu>  
                                        </div>     
                                        <div class="fields_input">
                                            <label><h:outputText value="Điểm đến"/> :</label>
                                            <h:selectOneMenu value="#{SPBean.pnFA000T}"  styleClass="cbx_a000" id="target">  
                                                <f:selectItems value="#{SPBean.cbxA000T}" />  

                                            </h:selectOneMenu> 


                                        </div>  

                                    </div>
                                    <!-- -->
                                    <div class="s400_right ">

                                        <div class="fields_input pricetour">
                                            <label class="label_number"><h:outputText value="Giá "/>*:</label>
                                            <h:inputText value="#{SPBean.pnSN204}" style="width:90px" styleClass="number required"><f:convertNumber pattern="#,###" /> </h:inputText>
                                            </div>
                                            <div class="fields_input datetour">
                                                <label class="lblMini"><h:outputText value="Số ngày"/>:</label>
                                            <h:inputText value="#{SPBean.pnSN206}" style="width:90px" styleClass="number"/>
                                        </div>
                                        <div class="fields_input timezonetour">
                                            <label class="lbltimzone"><h:outputText value="Múi giờ"/>:</label>
                                            <h:inputText value="#{SPBean.pnSN207}" style="width:90px"  styleClass="number"/>
                                        </div>
                                        <div class="fields_input counttour">
                                            <label class="lblcount"><h:outputText value="SL"/>:</label>
                                            <h:inputText value="#{SPBean.pnSN208}" style="width:90px"  styleClass="number"/>
                                        </div>    
                                    </div>
                                </div>
                                <!-- -->


                                <div class="s400_content ">
                                    <div class="fields_input ">
                                        <label class="lblCondition"><h:outputText value="Điều kiện tham gia"/>:</label>  
                                        <rich:editor viewMode="visual"
                                                     theme="advanced"
                                                     value="#{SPBean.pvSV205}" height="200" width="516" styleClass="editor" id="content">
                                            <jsp:include page="../../common/EditorComponent.jsp"></jsp:include>

                                        </rich:editor>
                                        <%--    <h:inputTextarea value="#{SPBean.pvSV205}" style="width:506px;height:200px" />--%>
                                    </div>
                                </div>

                                <h:panelGroup id="loadmessage"> <h:outputText style="color:red;font-size:12px;font-weight:bold;margin-left:270px;margin-top:10px;" value="#{SPBean.messageform}"/></h:panelGroup>
                                </div>

                            </div>

                        </div>
                        <div class="popup-footer">

                            <div class="buttonsave" onclick="self.parent.location='createProduct.jsp'"  ><span><h:outputText value="#{locale.close}"/></span></div>
                        <h:commandButton onclick="return validatecheck('job');" action="#{SPBean.updateS400}"  value="#{locale.save}" styleClass="buttonsave">
                            <a4j:support event="click" reRender="loadmessage"/>
                            <f:param value="#{SPBean.fs400}" name="fs400"/>
                        </h:commandButton>
                        <h:inputHidden value="#{SPBean.fs400}" id="ps400_0"/>



                    </div>
                </div>
            </a4j:form>
        </f:view>
    </body>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
    });
</script>
